@extends('backend::layout')
@section('title',trans($page_title))
@section('content')
    @component('backend::component.table.table-content')
        @slot('page_title') {{$page_title}} @endslot
        @slot('tools_btn')
            @component('backend::component.form.button')
                @slot('title') 添加类型 @endslot
                @slot('elem') a @endslot
                @slot('btn') btn @endslot
                @slot('color') info @endslot
                @slot('icon') hcl-goods-add1 @endslot
                @slot('class') modal-box @endslot
                @slot('params') {"area":"500px,400px","title":"添加商品类型"} @endslot
                @slot('href') {{route('b_ShopType_create')}} @endslot
            @endcomponent
            @component('backend::component.form.button')
                @slot('title') 批量删除 @endslot
                @slot('btn') btn @endslot
                @slot('color') danger @endslot
                @slot('icon') hcl-remove @endslot
                @slot('class') btn-ajax @endslot
                @slot('params')
                    {"url":"{{route('b_ShopType_batchDelete')}}","method":"post","title":"批量删除","targetData":".id","confirm":"true"}
                @endslot
            @endcomponent
        @endslot
        @slot('body_content')
            @if($list->isNotEmpty())
                <table class="list table table-bordered table-striped">
                    <thead>
                    <tr>
                        <th>
                            @component('backend::component.checkbox')
                                @slot('name') ids-all @endslot
                            @endcomponent
                        </th>
                        <th>类型名称</th>{{--<th>属性数量</th>--}}<th>规格数量</th><th>设置</th><th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    @foreach($list as $value)
                        <tr>
                            <td>
                                @component('backend::component.checkbox')
                                    @slot('name') ids[] @endslot
                                    @slot('class') id @endslot
                                    @slot('value') {{$value->id}} @endslot
                                @endcomponent
                            </td>
                            <td>{{$value->name}}</td>
{{--                            <td>{{count($value->attributes)}}</td>--}}
                            <td>{{count($value->specs)}}</td>
                            <td>
{{--                                @component('backend::component.a')--}}
{{--                                    @slot('title') 属性列表 @endslot--}}
{{--                                    @slot('class') text-primary @endslot--}}
{{--                                    @slot('href') javascript:; @endslot--}}
{{--                                @endcomponent--}}

                                @component('backend::component.a')
                                    @slot('title') 规格列表 @endslot
                                    @slot('class') text-primary @endslot
                                    @slot('href') {{route('b_ShopSpec_specs',['type'=>$value->id])}} @endslot
                                @endcomponent
                            </td>
                            <td>
                                @component('backend::component.form.button')
                                    @slot('title') 删除 @endslot
                                    @slot('icon') hcl-remove @endslot
                                    @slot('color') danger @endslot
                                    @slot('params') {"url":"{{route('b_ShopType_delete',['id'=>$value->id])}}","confirm":"true"} @endslot
                                    @slot('class') btn-ajax @endslot
                                @endcomponent

                                @component('backend::component.form.button')
                                    @slot('title') 编辑 @endslot
                                    @slot('elem') a @endslot
                                    @slot('href') {{route('b_ShopType_update',['id'=>$value->id])}} @endslot
                                    @slot('icon') hcl-edit1 @endslot
                                    @slot('color') primary @endslot
                                        @slot('class') modal-box @endslot
                                        @slot('params') {"area":"500px,400px","title":"编辑类型"} @endslot
                                @endcomponent

                            </td>
                        </tr>
                    @endforeach
                    </tbody>
                </table>
                @if($list->total()>$list->perPage())
                    @slot('list_page')
                        {{$list->links('backend::public.pagination')}}
                    @endslot
                @endif
            @else
                @component('backend::public.empty_page')
                    @slot('info') 暂时没有商品类型 @endslot
                @endcomponent
            @endif
        @endslot
    @endcomponent
@endsection